package com.sg.business.document.provider;

import com.mobnut.db.model.PrimaryObject;
import com.sg.business.model.Document;
import com.sg.widgets.commons.model.ISignProgramProvider;

public class SignProgramProvider implements ISignProgramProvider {

	@Override
	public String getSignProgramId(PrimaryObject doc) {
		if (doc instanceof Document) {
			Document document = (Document) doc;
			String value = (String) document.getValue(Document.F_PLM_ID);
			if (value != null) {
				if (value.contains("wt.epm")) {
					return "program.cad";
				} else if (value.contains("wt.doc")) {
					return "program.document";
				}
			} else {
				return "default";
			}
		}
		return null;
	}

}
